SQRT block

Short summary

Name

SQRT

→POU type

→function

Category

IEC-block, Numeric, block with internal error diagnostic

Conform to →IEC-standard

(tick) no restrictions

Graphical interface

Available since

  • version 1.18.0 (for Neuron Power Engineer)

  • version 3.1.0 (for library Standard) – For inputs of data type REAL, the optimized float variant of the C-runtime is used. Compared to previous versions, it is possible that (marginal) other results are returned within the threshold range of the block. 

Functionality

The mathematical function for the square root is called: The block returns the square root of the value connected to the input.

Inputs, return value

 

Identifier

→Data type

Description

Inputs:

IN

REAL, LREAL
(corresponds to →generic data type ANY_REAL)

input

Return value:

REAL, LREAL
(corresponds to →generic data type ANY_REAL)

 

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Internal error diagnostic for block 

The block checks the value connected to the input before it is executed.
If the value is < 0.0, the output ENO of the block is set to value FALSE (or an equivalent)

Example for usage within ST-editor

PROGRAM Test
   VAR
      result : REAL;
   END_VAR
   result := SQRT(IN := 4.4);    (* The variable 'result' evaluates to '2.097618'. *)
END_PROGRAM

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.